<%--
  Created by IntelliJ IDEA.
  User: xh
  Date: 2020/2/12
  Time: 16:13
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false"%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>消息详情 - 技术栈 -Java程序员成长平台</title>
    <meta name="keywords" content="">
    <meta name="description" content>
    <link rel="stylesheet" href="${APP_PATH}/vendor/layui-v2.4.5/layui/css/layui.css">
    <link rel="stylesheet" href="${APP_PATH}/css/common.css">
    <link rel="stylesheet" href="${APP_PATH}/css/header.css">
    <link rel="stylesheet" href="${APP_PATH}/css/footer.css">
    <link rel="stylesheet" href="${APP_PATH}/css/message-detail.css">
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<jsp:include page="head.jsp"></jsp:include>

<div class="layui-main g-main">
    <div class="layui-row l-blog-location-path">
               <span class="layui-breadcrumb">
                  <a href="${APP_PATH}/message/toIndex?pageNo=1&userId=${sessionScope.user.id}">消息管理</a>
                  <a><cite>消息详情</cite></a>
                </span>
        <input type="hidden" value="${requestScope.message.id}" id="Mid">
    </div>
    <div class="title">
        ${requestScope.message.title}
    </div>
    <div class="layui-row">
        <div class="l-send-info layui-col-xs10">发送人: ${requestScope.sendUser}，发送时间:${requestScope.message.sendTime}</div>
        <div class="layui-col-xs2 l-options">
            <button class="layui-btn layui-btn-sm layui-btn-primary layui-icon layui-icon-prev" onclick="back();">返回</button>
            <button class="layui-btn layui-btn-sm layui-btn-danger layui-icon layui-icon-delete" onclick="deleteMessage();">删除</button>
        </div>
    </div>
    <div class="l-send-content">${requestScope.message.main}</div>
</div>

<div class="g-footer layui-clear">
    <hr>
    <div>Copyright ©2018 技术栈(jishuzhan.club), All Rights Reserved.</div>
    <div>渝ICP备13001123号-2</div>
</div>

<script src="${APP_PATH}/vendor/holder.min.js"></script>
<script src="${APP_PATH}/vendor/layui-v2.4.5/layui/layui.js"></script>
<script src="${APP_PATH}/js/common.js"></script>
<script src="${APP_PATH}/js/message-detail.js"></script>
<script>
    function back() {
        window.location.href="${APP_PATH}/message/toIndex?pageNo=1&userId=${sessionScope.user.id}";
    }

    function deleteMessage() {
        var id=$("#Mid").val();
        layer.confirm("您确定要删除这条信息吗！", {icon: 3, title: '提示'}, function (cindex) {

            $.ajax({
                url: "${APP_PATH}/message/deleteById",
                method: "POST",
                data: id,
                success:function () {
                    window.location.href="${APP_PATH}/message/toIndex?pageNo=1&userId=${sessionScope.user.id}";
                }
            });

            layer.close(cindex);
        }, function (cindex) {
            layer.close(cindex);
        });

    }
</script>
</body>
</html>